package com.study.mybatis.plugins;

import lombok.Getter;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author yuantongqin
 * 2021/8/2
 **/
@Getter
public class Invocation {

    private Object target;
    private Method method;
    private Object[] args;


    public Invocation(Object target, Method method, Object[] args) {
        this.target = target;
        this.method = method;
        this.args = args;
    }

    public Object proceed() throws InvocationTargetException, IllegalAccessException {
        Object invoke = method.invoke(target, args);
        return invoke;
    }
}
